import java.util.Scanner;

/**
 * 
 */

/**
 * @author HOANB
 * 
 */
public class GradesAverage {

	private static Scanner input;

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		input = new Scanner(System.in);
		int arrayGrade[];
		System.out.println("Enter the number of student: ");
		int numberStudent = input.nextInt();
		int count = 0;
		float sum = 0;
		arrayGrade = new int[numberStudent];
		do {
			System.out.println("Enter the grade for Student " + (count + 1)
					+ " :");
			arrayGrade[count] = input.nextInt();
			if (arrayGrade[count] >= 0 && arrayGrade[count] <= 100) {
				count++;
			} else {
				System.out.println("Grades must be >=0 and <=100");
			}
		} while (count < 3);
		for (int i = 0; i < arrayGrade.length; i++) {
			sum += (float) arrayGrade[i];
		}
		System.out.println("Sum: " + sum);
		System.out.println("Average: " + (sum / numberStudent));
	}
}
